package com.lu.system.user.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.lu.system.user.dao.UserDao;
import com.lu.system.user.domain.UserDO;
import com.lu.system.user.service.UserService;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;
	
	@Override
	public UserDO get(Long userId){
		return userDao.get(userId);
	}
	
	@Override
	public List<UserDO> list(Map<String, Object> map){
		return userDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return userDao.count(map);
	}
	
	@Override
	public int save(UserDO user){
		return userDao.save(user);
	}

    @Override
    public void saveBatch(List<UserDO> user) throws Exception {
		userDao.saveBatch(user);
    }

	@Override
	public int update(UserDO user){
		userDao.update(user);
		//int i = 4/0;
		return 1;
	}

    @Override
    public void updateBatch(List<UserDO> user) throws Exception {
		userDao.updateBatch(user);
    }
	
	@Override
	public int remove(Long userId){
		return userDao.remove(userId);
	}
	
	@Override
	public int batchRemove(Long[] userIds){
		return userDao.batchRemove(userIds);
	}
	
}
